package org.enhance.web.exception;

import org.springframework.http.HttpStatus;

public class HttpStatusRuntimeException extends RuntimeException {

	private static final long serialVersionUID = 2192549690831732673L;

	private HttpStatus status = HttpStatus.BAD_REQUEST;

	public void setStatus(HttpStatus status) {
		this.status = status;
	}

	public HttpStatus getStatus() {
		return this.status;
	}

	public HttpStatusRuntimeException(Throwable throwable) {
		super(throwable.getMessage(), throwable);
	}

	public HttpStatusRuntimeException(int code, Throwable throwable) {
		super(throwable.getMessage(), throwable);
		this.status = HttpStatus.valueOf(code);
	}

}